#include "Buffer.h"

namespace MASGK
{

	CBuffer::CBuffer(void)
	{
	}


	CBuffer::~CBuffer(void)
	{
	}

	void CBuffer::SetPixel(int _x, int _y, uint _col)
	{
		m_ColorBuf[_x][_y] = _col;
	}

	uint CBuffer::To32BitColor(color& _col)
	{
		uint retCol;
		int r, g, b, a;

		r = (int) (_col.r * 255.0f);
		g = (int) (_col.g * 255.0f);
		b = (int) (_col.b * 255.0f);
		a = (int) (_col.a * 255.0f);


		retCol = a;
        retCol <<= 8;
        retCol |= r;
        retCol <<= 8;
        retCol |= g;
        retCol <<= 8;
        retCol |= b;

		return retCol;
	}
}